package threadTest.synchronizedTest.oddEven;

public class OddEvenClient {
	public static void main(String[] args) {
		int num = 10;
		OddEven oddEven = new OddEven(num);
		new Thread(()->{
			try {
				for (int i = 0; i < num; i++) {
					oddEven.printEven();
				}
			} catch (InterruptedException e) {
				throw new RuntimeException(e);
			}
		},"奇数线程").start();

		new Thread(()->{
			try {
				for (int i = 0; i < num; i++) {
					oddEven.printOdd();
				}
			} catch (InterruptedException e) {
				throw new RuntimeException(e);
			}
		},"偶数线程").start();
	}
}
